package com.qianfeng.dbsm.admin.common;


import com.qianfeng.dbsm.admin.entity.TbMember;

/**
 * 功能说明
 * 用于存放登录用户信息于ThreadLocal中
 * @author 袁俊杰
 * @date 2022-11-10 14:56:48
 */
public class MyUserContextHolder {


    static ThreadLocal<TbMember> userThreadLocal = new ThreadLocal<TbMember>();

    //存放user
    public static void setUser(TbMember user){
        userThreadLocal.set(user);
    }

    //取出user
    public static TbMember getUser(){
        return userThreadLocal.get();
    }

}
